package com.mdd.admin.validate.system;

import com.mdd.admin.validate.BaseParam;
import com.mdd.common.validator.annotation.IntegerContains;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;

@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class SystemConsumptionRewardConfigParam extends BaseParam {

    @NotNull(message = "enable参数缺失", groups = {create.class, update.class})
    @IntegerContains(values = {0, 1}, message = "enable参数值不在符合范围", groups = {create.class, update.class})
    private Integer enable;

    @NotNull(message = "奖励对象缺失", groups = {create.class, update.class})
    @IntegerContains(values = {0, 1}, message = "奖励对象参数值不在符合范围", groups = {create.class, update.class})
    private Integer award_object;

    @NotNull(message = "奖励方式缺失", groups = {create.class, update.class})
    @IntegerContains(values = {0, 1}, message = "奖励方式参数值不在符合范围", groups = {create.class, update.class})
    private Integer reward_method;

    @NotNull(message = "事件参数缺失", groups = {create.class, update.class})
    @IntegerContains(values = {0, 1}, message = "事件参数值不在符合范围", groups = {create.class, update.class})
    private Integer event;

    @NotNull(message = "积分方式参数缺失", groups = {create.class, update.class})
    @IntegerContains(values = {0, 1}, message = "积分方式参数值不在符合范围", groups = {create.class, update.class})
    private Integer integral_method;

    @NotNull(message = "奖励积分/奖励积分比例缺失", groups = {create.class, update.class})
    @DecimalMin(value = "0", message = "奖励积分不能少于0/奖励积分比例不能少于0", groups = {create.class, update.class})
    private BigDecimal integral_value;

}
